/*
 * @Description:
 * @Author:
 * @Date: 2022-03-25 10:21:17
 * @LastEditTime: 2022-03-31 11:00:42
 */
import 'element-plus/dist/index.css';
import router from './router/index.js';
import App from './App.vue';
import store from './store/index.js';
import '@/assets/scss/index.scss';
import '@/assets/icon/iconfont.css';
// 注册指令
import allDirective from '@/directive/index';
// 注册全局方法
import plugins from '@/plugins/index';
import './permission';
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import svgIcon from './icons/index.vue'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(router);
app.use(store);
app.use(plugins);
app.component('svg-icon', svgIcon)
app.mount(`#app`);

// 注册全局指令
Object.keys(allDirective).forEach(name => {
	const obj: any = allDirective;
	app.directive(name, obj[name]);
});
